﻿namespace linkedin_bot_demo.Common.Converters
{
	using System;
	using System.Windows.Data;
	using System.Globalization;
	using System.Windows.Markup;

	[ValueConversion(typeof(object), typeof(bool))]
    public class IsNotNullValueConverter : MarkupExtension, IValueConverter
	{
        public IsNotNullValueConverter() { }


		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
		{
			return value != null;
		}


		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
		{
			throw new NotSupportedException();
		}


		public override object ProvideValue(IServiceProvider serviceProvider)
		{
			return this;
		}
	}

}
